package com.lhy.admin.common.mvcplus.wrapper.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lhy.admin.common.mvcplus.entity.ComparatorEnum;
import com.lhy.admin.common.mvcplus.entity.DbField;
import com.lhy.admin.common.mvcplus.wrapper.AbstractSearchComparator;

public class NotInSearchComparator extends AbstractSearchComparator {
    @Override
    public void accept(QueryWrapper queryWrapper, DbField dbField) {
        String[] values = splitStr(dbField.getValue());
        if (values.length > 0) {
            queryWrapper.notIn(dbField.getName(), values);
        }
    }

    @Override
    public ComparatorEnum comparatorEnum() {
        return ComparatorEnum.NOT_IN;
    }
}
